package org.jeecg.modules.xxgx.kpzdgl.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.common.util.LoginUserUtil;
import org.jeecg.modules.xxgx.kpzdgl.entity.CsXxKpzd;
import org.jeecg.modules.xxgx.kpzdgl.entity.CsXxKpzdSmplParam;
import org.jeecg.modules.xxgx.kpzdgl.entity.CsXxKpzdsq;
import org.jeecg.modules.xxgx.kpzdgl.service.ICsXxKpzdService;
import org.jeecg.modules.xxgx.kpzdgl.service.ICsXxKpzdsqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

/**
* @Description: 开票终端授权扩展
* @Author: jeecg-boot
* @Date:   2023-09-19
* @Version: V1.0
*/
@Api(tags="开票终端授权")
@RestController
@RequestMapping("/xxgx/kpzdgl/csXxKpzdsqkz")
@Slf4j
public class CsXxKpzdsqkzController extends JeecgController<CsXxKpzdsq, ICsXxKpzdsqService> {
   @Autowired
   private ICsXxKpzdsqService csXxKpzdsqService;

   /**
    * 根据当前用户获取开票终端信息
    *
    * @param req
    * @return
    */
   @ApiOperation(value="根据当前用户获取开票终端信息", notes="根据当前用户获取开票终端信息")
   @GetMapping(value = "/getKpzdsByUserKpzdsq")
   public Result<List<CsXxKpzd>> getKpzdsByUserKpzdsq(@RequestParam(name="companyId",required = false) String companyId,
                                               @RequestParam(name="nsrsbh",required = false) String nsrsbh,
                                               @RequestParam(name="zdlx",required = false) String zdlx,
                                               HttpServletRequest req) {
       LoginUser user=LoginUserUtil.getLoginUser();
       List<CsXxKpzd> list=csXxKpzdsqService.getKpzdsByUserKpzdsq(user.getUsername(),user.getCompanyId(),nsrsbh,zdlx);
       return Result.OK(list);
   }

}
